package com.ygxsk.carhome.response;

import android.os.Parcel;
import android.os.Parcelable;

import com.ygxsk.carhome.ui.archive.ArchiveFileAddSubmitActivity;
import com.zhongjh.progresslibrary.widget.MaskProgressLayout;

import java.util.ArrayList;
import java.util.HashMap;

/*
 * @Author:itchenqi175@163.com
 * @Time:2024/2/21  19:45
 * @Description:档案附件的动态控制接口
 */
public class ArchiveFileType implements Parcelable {

//    {
//            "fileTypeName":"三包凭证",
//            "fileType":3,
//            "required":true
//    },

    private String fileTypeName;
    private int fileType;
    private boolean required;

    //九宫格的布局内容，目的是为了在主页面直接修改该布局内容
    private transient MaskProgressLayout maskProgressLayoutInItem;

    private transient ArchiveFileAddSubmitActivity.MyFooterMaskProgressLayoutListener myFooterMaskProgressLayoutListener;

    //因为有删除，有新增，做key的管理
    private transient ArrayList<HashMap<String, Object>> fileSingleUpLoadFiles_hashMap = new ArrayList<>();


    public ArchiveFileAddSubmitActivity.MyFooterMaskProgressLayoutListener getMyFooterMaskProgressLayoutListener() {
        return myFooterMaskProgressLayoutListener;
    }

    public void setMyFooterMaskProgressLayoutListener(ArchiveFileAddSubmitActivity.MyFooterMaskProgressLayoutListener myFooterMaskProgressLayoutListener) {
        this.myFooterMaskProgressLayoutListener = myFooterMaskProgressLayoutListener;
    }

    public MaskProgressLayout getMaskProgressLayoutInItem() {
        return maskProgressLayoutInItem;
    }

    public void setMaskProgressLayoutInItem(MaskProgressLayout maskProgressLayoutInItem) {
        this.maskProgressLayoutInItem = maskProgressLayoutInItem;
    }

    public ArrayList<HashMap<String, Object>> getFileSingleUpLoadFiles_hashMap() {
        return fileSingleUpLoadFiles_hashMap;
    }

    public void setFileSingleUpLoadFiles_hashMap(ArrayList<HashMap<String, Object>> fileSingleUpLoadFiles_hashMap) {
        this.fileSingleUpLoadFiles_hashMap = fileSingleUpLoadFiles_hashMap;
    }

    public String getFileTypeName() {
        return fileTypeName;
    }

    public void setFileTypeName(String fileTypeName) {
        this.fileTypeName = fileTypeName;
    }

    public int getFileType() {
        return fileType;
    }

    public void setFileType(int fileType) {
        this.fileType = fileType;
    }

    public boolean isRequired() {
        return required;
    }

    public void setRequired(boolean required) {
        this.required = required;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.fileTypeName);
        dest.writeInt(this.fileType);
        dest.writeByte(this.required ? (byte) 1 : (byte) 0);
    }

    public void readFromParcel(Parcel source) {
        this.fileTypeName = source.readString();
        this.fileType = source.readInt();
        this.required = source.readByte() != 0;
    }

    public ArchiveFileType() {
    }

    protected ArchiveFileType(Parcel in) {
        this.fileTypeName = in.readString();
        this.fileType = in.readInt();
        this.required = in.readByte() != 0;
    }

    public static final Parcelable.Creator<ArchiveFileType> CREATOR = new Parcelable.Creator<ArchiveFileType>() {
        @Override
        public ArchiveFileType createFromParcel(Parcel source) {
            return new ArchiveFileType(source);
        }

        @Override
        public ArchiveFileType[] newArray(int size) {
            return new ArchiveFileType[size];
        }
    };
}
